package org.greyhawk.samonitor.service;

import java.util.TimerTask;

import org.greyhawk.samonitor.domain.ImageResourcesFactory;
import org.greyhawk.samonitor.domain.ResourcesFactory;
import org.greyhawk.samonitor.domain.TextResourcesFactory;

public class CrawlerTask extends TimerTask{

	@Override
	public void run(){
		SiteCrawler siteCrawler = new SiteCrawler();
		SummaryGenerater summaryGenerater = new Md5SummaryGenerater();
		ResourcesFactory imageResourcesFactory = new ImageResourcesFactory(siteCrawler,summaryGenerater);
		ResourcesFactory textResourcesFactory = new TextResourcesFactory(summaryGenerater);
		ResourcesCrawler resourcesCrawler = new ResourcesCrawler(imageResourcesFactory,textResourcesFactory);
		resourcesCrawler.execute();
	}

}
